<html>
<head>
<script>

Object.prototype.do = function(fn){
	

	//return fn.apply(this, [this].slice.call(arguments, 1));
	var slice = Array.prototype.slice;
	var args = slice.apply(arguments);
	debugger;
	args[0] = this;
	//args.push(this);
	//var a = args.concat(slice.apply(arguments));
	var a = args.concat([]);
	return fn.apply(this, a);
}

var EmbeddedLangTest = (function () {
	return {
		Program : (function () {
			return {
				TestForPrime3: function (candidate) {if(candidate < 2){
						return false;
					}else{
						for(var EmJs_0 = 2, EmJs_1 = Math.floor(Math.sqrt(candidate)) + 1;  EmJs_0 < EmJs_1; EmJs_0++)
							{if(candidate % EmJs_0 === 0){return false;}}
						return true;
					}
				}
			};
		}())
	};
}());

	function Test2(a, b, c, d, e, f, g){
		debugger;
		 var i = 1;
	}
    function Test() {
        var b = EmbeddedLangTest.Program.TestForPrime3(11);
        //alert(b);
		//debugger;
		var obj = { num: 11};
		var c = obj.do(Test2, 8, "1");
    }
</script>

</head>
<body>
<input type="button" value="test" onclick="Test()" />
</body>
</html>